package com.weizai.carshop.controller;


import com.weizai.carshop.common.result.ResponseResult;
import com.weizai.carshop.model.entiity.ShopCateInfoEntity;
import com.weizai.carshop.service.ShopCateInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/shopCateInfo")
@RequiredArgsConstructor
public class ShopCateInfoController {


    private final ShopCateInfoService shopCateInfoService;


    @GetMapping
    public ResponseResult cateInfo(Long id) {
        List<ShopCateInfoEntity> list = shopCateInfoService.lambdaQuery().eq(ShopCateInfoEntity::getCateId, id).list();
        return ResponseResult.okResult(list);
    }

}
